import { createApp } from 'vue'
// 引入pinia大仓库
import pinia from '@/stores'
// 引入element-plus组件和图标
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import 'element-plus/theme-chalk/dark/css-vars.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
// 引入element-plus组件国际化语言
import zhCn from 'element-plus/es/locale/lang/zh-cn'
// 引入svg矢量图插件
import 'virtual:svg-icons-register'
// 引入SvgIcon组件
import SvgIcon from '@/components/SvgIcon/index.vue'
// 引入路由鉴权
import './permisstion'
// 引入全局样式
import '@/assets/styles/index.css'

import App from './App.vue'
import router from './router'


const app = createApp(App)

// 注册element-plus组件和图标
app.use(ElementPlus, {
  locale: zhCn,//配置element-plus组件国际化
})
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
// 注册SvgIcon组件
app.component('SvgIcon', SvgIcon)

app.use(pinia)
app.use(router)


app.mount('#app')
